#include "head.h"
#include "unistd.h"
#define MAX 100
void Progress_bar(int time_s)
{
    char ch[MAX];
    char symbol[] = {'|', '\\', '-', '/'};
    char against_symbol[] = {'|','/','-','\\'};
    int time = time_s;
    int i;
    memset(ch, 0, sizeof(ch));
    system("clear");
    for (i = 0; i < 100; i++)
    {
            printf("[%-100s] %d%% %c %c\r", ch, i, symbol[i % 4],against_symbol[i % 4]);
            ch[i] = '>';
            fflush(stdout);
            usleep(10000 * time); // 0.01s
    }
    system("clear");
}
